home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Tools 4
/
Amiga Tools 4.iso
/
tools
/
mail-tools
/
thor
/
thor_2.22
/
thor.lha
/
rexx
/
SendMail.thor
< prev
next >
Wrap
Text File
|
1995-12-18
|
2KB
|
65 lines
/* SendMail.thor by Troels Walsted Hansen <troelsh@powertech.no>
** $VER: SendMail.thor v1.00 (07.08.95)
**
** This is a very simple script designed for use with AMosaic's new mailto:
** support. Set ENV:Editor to your prefered editor (I use "GED Y"), and
** ENV:SendMail to "RX THOR:Rexx/SendMail.thor" (substitute "THOR:Rexx/" for
** the path where you put this script).
**
** Now change the two variables below to whatever fits for your setup.
** MailSystem is the name of your TCP/SOUP/UUCP/whatever email system in
** THOR, and MailConfName is obviously the name of your email conference in
** THOR.
**
** Sending a mailto: with AMosaic should now produce an EnterMsg event in THOR.
** The mail will be sent the next time you use Send Events from ConenctTHOR,
** upload your SOUP reply package, or whatever.
**
** Note: THOR does not have to be running for this script to work!
*/
MailSystem = 'News&Mail'
MailConfName = 'Email'
/* DON'T CHANGE ANYTHING BELOW HERE */
if ~show('p', 'BBSREAD') then do
address command
"run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
"WaitForPort BBSREAD"
end
address(BBSREAD)
/* parse the header AMosaic provides */
str = readln('STDIN')
EVENT.TOADDR = word(str, 2)
EVENT.SUBJECT = substr(readln('STDIN'), 10)
call readln('STDIN')
/* put the body of the message in a file with a unique name */
UNIQUEMSGFILE bbsname '"'MailSystem'"' stem UNIQUEFILE
if(rc ~= 0) then exit
call open(tmp, UNIQUEFILE.NAME, W)
do until eof('STDIN')
call writeln(tmp, readln('STDIN'))
end
call close(tmp)
/* fill out some more variables that BBSREAD require */
EVENT.CONFERENCE = MailConfName
EVENT.MSGFILE = UNIQUEFILE.FILEPART
/* write the event */
WRITEBREVENT bbsname '"'MailSystem'"' event 0 stem EVENT
if(rc ~= 0) then exit
exit